<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>9.8练习</title>
</head>
<body>
<button onclick="clearTime()">setTimeout失效</button>
<button onclick="stopInterval()">setInterval失效</button>
<script type="text/javascript">
    //screen属性数据
    console.log(screen.availHeight);
    console.log(screen.availWidth);
    console.log(screen.height);
    console.log(screen.width);
    //Timeout测试
    function clearTime(){
        clearTimeout(timeout) ;
    }
    let timeout = setTimeout( function(){
        console.log( "setTimeout执行了") ;
        console.log( 1+1 ) ;
    } , 5000) ;
    console.log( timeout ) ;
    //Interval测试
    let interval = function (){
        console.log( new Date() +"函数中的方法执行了") ;
    }
    let x = setInterval( interval , 1000) ;
    function stopInterval(){
        clearInterval( x ) ;
    }

</script>
</body>
</html>